package cn.dankal.flyaudio.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;

import cn.dankal.basiclib.base.recyclerview.BaseRecyclerViewAdapter;
import cn.dankal.basiclib.base.recyclerview.BaseRecyclerViewHolder;
import cn.dankal.basiclib.util.image.PicUtils;
import cn.dankal.flyaudio.R;
import cn.jpush.im.android.api.model.UserInfo;

public class SearchUserAdapter extends BaseRecyclerViewAdapter<UserInfo> {
    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.item_contract_person;
    }

    @Override
    protected BaseRecyclerViewHolder getViewHolder(ViewGroup parent, View rootView, int viewType) {
        return new ViewHolder(rootView);
    }

    public class ViewHolder extends BaseRecyclerViewHolder<UserInfo>{

        public ViewHolder(View itemView) {
            super(itemView);
        }

        @Override
        public void onBindData(UserInfo data, int position) {
            setText(R.id.tv_name, data.getNickname());
            PicUtils.loadAvatar(data.getAvatarFile(),(ImageView) itemView.findViewById(R.id.iv_avatar));
        }
    }
}
